define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {
		function get_data_statistics(result) {
			if(false) {
				result = '{"success": true,"msg": "","result": {"name": "促销","total_count": 100,"total_money": 1000,"total_attention_num": 500,"total_jion_num": 200,"region": ['+
            '{"region_id": "001","region_name": "江苏","attention_num": 100,"jion_num": 200,"count": 300,"money": 400},'+
            '{"region_id": "002","region_name": "浙江","attention_num": 500,"jion_num": 600,"count": 700,"money": 800}],"store": ['+
            '{"store_id": "001","store_name": "店铺1","attention_num": 100,"jion_num": 200,"count": 300,"money": 400},'+
            '{"store_id": "002","store_name": "店铺2","attention_num": 500,"jion_num": 600,"count": 700,"money": 800}]},"session": "7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			} else {
				return result;
			}
		}
		//返回信息
		return {
			//制造商促销活动统计
			promotion_statistics: function(act_id, callback) {
				//post请求
				Http.post({
					method: 'marketing.statistics',
					seesion: '',
					act_id: act_id,
					act_type: 1

				}, function(result) {
					//函数回调
					if(callback)
						callback(get_data_statistics(result).result);

				}, function(e) {

				}, function() {

				});
			},
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Promotionaddup_agent", factory);
});